Repository navigation
Conversation
…p in buffered log records
|
|
heyy @leandrodamascena pls review my PR and let me know if anythings needs to be added, changed or removed. |
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @dropps07! This is the fix I hoped for: one code path, and a buffered record now prints exactly like the unbuffered one. I wrote a side-by-side probe for stacklevel, a saved exception, a third-party logger with stack_info and the timestamp, and with your branch the two outputs are identical on every field. Keeping only True as "resolve now" is the right reading of exc_info. Goes out in 3.42.0, no need to rebase, you'll be in the release notes.
perfect. sounds good :) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #8837 +/- ##
===========================================
- Coverage 97.20% 97.14% -0.06%
===========================================
Files 327 327
Lines 16759 16785 +26
Branches 1523 1528 +5
===========================================
+ Hits 16290 16306 +16
- Misses 328 336 +8
- Partials 141 143 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
heyy @leandrodamascena do i have to resolve codecov issues ?? |
|
Hi @leandrodamascena, this PR is approved and ready on my side. Could you please merge it when you get a chance so it makes 3.42.0. Thanks. |



Issue number: closes #8824
Summary
Changes
Buffered log records now print exactly as they would have been without buffering. Three fixes in the same code path:
User experience
Before: a buffered debug log from a wrapper with stacklevel=3 reported the wrapper instead of the business function, a third-party log showed location handle:1028 with the Powertools logger name, an exception logged outside its except block flushed with no exception, and every flushed record printed the flush time. After: each flushed record is identical to the same log without buffering, same location, name, stack info, exception and timestamp.
Verification
I ran the tests myself and pasted what I saw, I did not describe runs I did not do.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.